package Java9_15;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Supermaket implements Serializable {
    private String name, tel, address;

    List<Vip> list = new ArrayList<>();

    public Supermaket() {
    }

    public Supermaket(String name, String tel, String address) {
        this.name = name;
        this.tel = tel;
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public boolean register(Vip vip) {
        if (list.contains(vip)) {
            return false;
        }
        list.add(vip);
        return true;
    }

    public void show() {
        for (Vip p : list) {
            System.out.println(p);
        }
    }
}
